import request from '@/config/axios'

export const updateGoodsSource = async (data) => {
  return await request.putDYXT({
    url: '/goods-source/update',
    data
  })
}

export const completeGoodsSource = async (data) => {
  return await request.putDYXT({
    url: '/goods-source/complete',
    data
  })
}

export const cancelGoodsSource = async (data) => {
  return await request.putDYXT({
    url: '/goods-source/cancel',
    data
  })
}

export const getGoodsSourcePage = async (params) => {
  return await request.getDYXT({
    url: '/goods-source/page',
    params
  })
}

export const getGoodsSource = async (params) => {
  return await request.getDYXT({
    url: '/goods-source/get',
    params
  })
}

export const getGoodsSourceDetail = async (params) => {
  return await request.getDYXT({
    url: '/goods-source/getDetails',
    params
  })
}

export const getOrderReceiveMode = async (params) => {
  return await request.getDYXT({
    url: '/goods-source/get-order-receive-mode',
    params
  })
}

export const getOrdersByGoodsSourceId = async (params) => {
  return await request.getDYXT({
    url: '/goods-source/get-orders-by-goods_source_id',
    params
  })
}

export const exportOrdersByGoodsSourceId = async (
  params
) => {
  return await request.downloadDYXT({
    url: '/goods-source/export-orders-by-goods_source_id',
    params
  })
}

export const getLineList = async (params) => {
  return await request.getDYXT({
    url: '/qeRoute/getList',
    params
  })
}

export const bindVehicles = async (data) => {
  return await request.putDYXT({
    url: '/qeRoute/bindVehicles',
    data
  })
}
